﻿<!DOCTYPE html>
<script src="Scripts/info.js"></script>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
</head>
<body>
    <p style="text-align: center;"><b>网络一线牵，珍惜这段缘，欢迎进入登录界面</b></p>
    <form name="mf" action="MyWeb.html" method="post">
        <table align="center" border="0">
            <tr>
                <td align="right">用户名：</td>
                <td align="left"><input name="username" type="text"></td>
            </tr>
            <tr>
                <td align="right">密码：</td>
                <td align="left"><input name="userpsd" type="password"></td>
            </tr>
            <tr>
                <td align="right">性别：</td>
                <td align="left">
                    <select name="sex">
                        <option>男</option>
                        <option>女</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">所在地：</td>
                <td align="left">
                    <select name="province" id="param_province" onchange="provincechange(this.selectedIndex);">
                        <option>请选择省份</option>
                    </select>
                    <select name="city" id="param_city">
                        <option>请选择城市</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">爱好：</td>
                <td align="left">
                    <input type="checkbox" name="c1">唱
                    <input type="checkbox" name="c1">跳
                    <input type="checkbox" name="c1">rap
                    <input type="checkbox" name="c1">篮球
                </td>
            </tr>
            <tr>
                <td></td>
                <td align="left">
                    <input name="loginbtn" type="submit" value="确定">
                    <input name="loginrst" type="reset" value="重置">
                </td>
            </tr>
        </table>
    </form>
    <script>
        window.onload = function () { init(); };
        function init() {
            var province = document.getElementById('param_province');
            //给选择框一个高度，可直接写进数据，不然要先创建dom元素option再录值
            province.length = provinces.length;
            for (var i = 0; i < provinces.length; i++) {
                province.options[i].text = provinces[i];
                province.options[i].value = provinces[i];
            }
        }
        function provincechange(n) {
            var city = document.getElementById('param_city');
            var citystemp = citys[n];
            city.length = citystemp.length;
            for (var i = 0; i < citystemp.length; i++) {
                city.options[i].text = citystemp[i];
                city.options[i].value = citystemp[i];
            }
            city.options[0].selected = true;
        }
    </script>
</body>

</html>